package com.gumanx;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class WorldGenerator implements IWorldGenerator {

	@Override
	public void generate(Random random, int chunkX, int chunkZ, World world,
			IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
		switch(world.provider.dimensionId){
		case -1:
		    generateNether(world, random, chunkX * 16, chunkZ * 16);
		    break;
		case 0:
		    generateSurface(world, random, chunkX * 16, chunkZ * 16);
		    break;
		case 1:
		    generateEnd(world, random, chunkX * 16, chunkZ * 16);
		    break;
		}
	}

	private void generateEnd(World world, Random random, int i, int j) {
		
	}

	private void generateSurface(World world, Random random, int chunkX, int chunkZ) {
		for(int k = 0; k < 8; k++) {
			int stelleriumXCoord = chunkX + random.nextInt(16);
			int stelleriumYCoord = random.nextInt(10);
			int stelleriumZCoord = chunkX + random.nextInt(16);
			
			(new WorldGenMinable(_GumanxModBase.BlockOreStellerium.blockID, 5)).generate(world, random, stelleriumXCoord, stelleriumYCoord, stelleriumZCoord);
		}
		
		/**
		 * The for loop sets how often the ore is generated
		 */
		for(int k = 0; k < 15; k++) {
			int tungstenXCoord = chunkX + random.nextInt(16);
			int tungstenYCoord = random.nextInt(20);				//Sets what lvl the ore begins to generate
			int tungstenZCoord = chunkZ + random.nextInt(16);
			
			(new WorldGenMinable(_GumanxModBase.BlockOreTungsten.blockID, 10)).generate(world, random, tungstenXCoord, tungstenYCoord, tungstenZCoord);
		}
	}

	private void generateNether(World world, Random random, int i, int j) {
		
	}

}
